package com.dk.controller;

import com.dk.bean.Result;
import com.dk.em.ResultEnum;
import com.dk.pojo.AppointmentVO;
import com.dk.service.AppointmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("appointment")
@Api(description = "商家预约查询")
public class AppointmentController {

    @Autowired
    private AppointmentService appointmentService;

    @GetMapping("/{sellerId}")
    @ApiOperation(value = "商家预约查询")
    public Result toSelect(@PathVariable("sellerId")Long sellerId) {
        List<AppointmentVO> appointments = appointmentService.toSelect(sellerId);
        return Result.buildResult(ResultEnum.SUCCESS).setData(appointments);
    }

}
